home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mathfl / mf_limit.frm < prev    next >
Text File  |  1995-12-05  |  3KB  |  132 lines

  1. VERSION 2.00
  2. Begin Form limit 
  3.    Caption         =   "Change Limits"
  4.    ClientHeight    =   2820
  5.    ClientLeft      =   1665
  6.    ClientTop       =   1740
  7.    ClientWidth     =   6585
  8.    Height          =   3225
  9.    Icon            =   MF_LIMIT.FRX:0000
  10.    Left            =   1605
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form2"
  13.    ScaleHeight     =   2820
  14.    ScaleWidth      =   6585
  15.    Top             =   1395
  16.    Width           =   6705
  17.    Begin TextBox stud_name 
  18.       FontBold        =   -1  'True
  19.       FontItalic      =   0   'False
  20.       FontName        =   "MS Sans Serif"
  21.       FontSize        =   12
  22.       FontStrikethru  =   0   'False
  23.       FontUnderline   =   0   'False
  24.       Height          =   495
  25.       Left            =   2760
  26.       TabIndex        =   0
  27.       Text            =   " "
  28.       Top             =   240
  29.       Width           =   1575
  30.    End
  31.    Begin SpinButton Spin2 
  32.       Height          =   615
  33.       Left            =   4080
  34.       Top             =   1080
  35.       Width           =   495
  36.    End
  37.    Begin CommandButton Command1 
  38.       Caption         =   "Accept Parameters"
  39.       Default         =   -1  'True
  40.       Height          =   615
  41.       Left            =   2040
  42.       TabIndex        =   2
  43.       Top             =   2040
  44.       Width           =   2055
  45.    End
  46.    Begin Label upper 
  47.       Caption         =   " "
  48.       FontBold        =   -1  'True
  49.       FontItalic      =   0   'False
  50.       FontName        =   "MS Sans Serif"
  51.       FontSize        =   24
  52.       FontStrikethru  =   0   'False
  53.       FontUnderline   =   0   'False
  54.       Height          =   495
  55.       Left            =   2760
  56.       TabIndex        =   5
  57.       Top             =   1080
  58.       Width           =   1215
  59.    End
  60.    Begin Label Label1 
  61.       Caption         =   "Upper limit = 10 draws objects on screen."
  62.       Height          =   615
  63.       Left            =   4800
  64.       TabIndex        =   4
  65.       Top             =   1080
  66.       Width           =   1695
  67.    End
  68.    Begin Label Label3 
  69.       Caption         =   "Enter Student Name Here"
  70.       Height          =   255
  71.       Left            =   240
  72.       TabIndex        =   3
  73.       Top             =   240
  74.       Width           =   2295
  75.    End
  76.    Begin Label Label2 
  77.       Caption         =   "Upper Limit of Numbers"
  78.       Height          =   255
  79.       Left            =   360
  80.       TabIndex        =   1
  81.       Top             =   1200
  82.       Width           =   2295
  83.    End
  84. End
  85.  
  86.  
  87. Sub Command1_Click ()
  88.     If stud_name.Text = "" Then
  89.         MsgBox "Please enter a name for the student."
  90.         limit.Show
  91.         stud_name.SetFocus
  92.         Exit Sub
  93.     End If
  94.     student_name = LTrim$(stud_name.Text)
  95.     upper_limit = Val(upper.Caption)
  96.     main.Show
  97. End Sub
  98.  
  99. Sub form_load ()
  100. If upper_limit = 0 Then
  101.     upper.Caption = "10"
  102. Else
  103.     upper.Caption = Str$(upper_limit)
  104. End If
  105. If student_name <> " " Then
  106.     stud_name.Text = student_name
  107. End If
  108. End Sub
  109.  
  110. Sub Spin2_SpinDown ()
  111. upper.Caption = Str$(Val(upper.Caption) - 10)
  112. If Val(upper.Caption) < 10 Then
  113.     upper.Caption = " 10"
  114. End If
  115.  
  116. upper.Refresh
  117. End Sub
  118.  
  119. Sub Spin2_SpinUp ()
  120. upper.Caption = Str$(Val(upper.Caption) + 10)
  121. If Val(upper.Caption) = 110 Then
  122.     upper.Caption = " 100"
  123. End If
  124.  
  125. upper.Refresh
  126. End Sub
  127.  
  128. Sub upper_GotFocus ()
  129. stud_name.SetFocus
  130. End Sub
  131.  
  132.